package org.example.mutiparam;

import cn.hutool.core.util.CharsetUtil;
import cn.hutool.extra.compress.CompressUtil;
import net.jpountz.lz4.LZ4Factory;

import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author zhangjg
 * @desc s
 * @date 2022/12/06 16:40
 **/
public class MultTest {


    public static void main(String[] args) {
//        List<String> list = new ArrayList<String>();
//        list.add("a");
//        list.add("b");
//        t("1","x");
//        t(list.toArray(new String[list.size()]));
        MultTest.t1();
    }


    public static void  t(String ... string){

        System.out.println(Arrays.asList(string));

    }

    public static void t1(){
        int length = 10000;
        StringBuffer sb = new StringBuffer();
        for(int i=0;i<length;i++){
            sb.append("i");
        }
        String str = sb.toString();
        byte[] arr = str.getBytes(StandardCharsets.UTF_8);

        byte[] compress = LZ4Factory.fastestInstance().fastCompressor().compress(arr);
        byte[] compress2 = LZ4Factory.fastestInstance().highCompressor().compress(arr);

        System.out.println("str.length="+arr.length+"  compress.length="+compress.length+"  compress2.length="+compress2.length);

    }

}
